#!/usr/bin/python
# -*- coding: UTF8 -*-
import baseClass
import logs

class Accs(object):
	massAccsForAllService = {}
	nameServices = []
	def getAccService(self, nameService):
		massAccs = baseClass.setFileData('account/'+nameService+'.txt')
		
#		asdfasdf  = logs.logs()
#		asdfasdf.writeLogInFile('aasdfasdfasd')
		self.massAccsForAllService[nameService] = massAccs

	def getNameServiceAccs(self):
		#poluchit spisok file for dostupnih servicov
		self.nameServices += ['mailru','qipru','twittercom', 'yandexru']

	#Очистка от \n, \r
	def delSymbolEndStr(self):
		massTemp = {}
		for service in self.massAccsForAllService.keys():

			massAccount = []
			for account in self.massAccsForAllService[service]:
				account = account.replace('\n',"")
				account = account.replace('\r',"")
				massAccount += [account]
			massTemp[service] = massAccount

		self.massAccsForAllService = massTemp


	def addAllAccService(self):
		i = 0
		for elem in self.nameServices:
			
			self.getAccService(elem)
			i = i+1



